// 变量定义
$border-color: var(--el-border-color);
$border-color-light: var(--el-border-color-light);
$text-color-primary: var(--el-text-color-primary);
$text-color-regular: var(--el-text-color-regular);
$color-primary: var(--el-color-primary);
$color-primary-light-9: var(--el-color-primary-light-9);

// 详情页通用样式
.card-fill {
  .el-card {
    //margin-bottom: 16px;
    transition: all 0.3s;

    &:hover {
      box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    }
  }

  .el-descriptions {
    margin-bottom: 16px;

    // 优化header样式
    :deep(.el-descriptions__header) {
      margin-bottom: 8px; // 减小header底部间距

      .el-descriptions__title {
        margin-bottom: 0; // 移除标题底部间距
      }
    }

    // 标题样式
    .title {
      font-size: 15px;
      font-weight: 500;
      color: $text-color-primary;
      margin: 0; // 移除标题外边距
      display: flex;
      align-items: center;
      padding: 4px 0; // 减小上下内边距
      border-bottom: 1px solid $border-color-light;
      position: relative;

      i {
        margin-right: 6px;
        font-size: 16px;
        color: $color-primary;
      }

      span {
        color: $text-color-primary;
      }

      &::before {
        content: '';
        width: 3px;
        height: 14px;
        background-color: $color-primary;
        margin-right: 6px;
        border-radius: 2px;
      }
    }

    // 描述项样式
    :deep(.el-descriptions__body) {
      .el-descriptions__table {
        border: 1px solid $border-color-light;

        .el-descriptions__cell {
          padding: 12px;

          &.el-descriptions__label {
            width: 140px;
            background-color: #fafafa;
            color: $text-color-regular;
            font-weight: normal;
            font-size: 14px;
          }

          &.el-descriptions__content {
            color: $text-color-primary;
            font-size: 14px;

            &.is-key-info {
              font-weight: 500;
              color: $text-color-primary;
            }
          }
        }
      }
    }
  }

  // 图片上传组件样式
  .details-upload-img {
    :deep(.el-upload-list) {
      .el-upload-list__item {
        margin: 0;

        img {
          width: 100px; // 进一步减小图片尺寸
          height: 120px; // 保持合适的长宽比
          object-fit: cover;
          border-radius: 4px;
        }
      }
    }
  }

  // 底部按钮样式
  .footer {
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid $border-color-light;
    text-align: right;
  }
}

// 响应式布局
@media screen and (max-width: 1200px) {
  .el-descriptions {
    --el-descriptions-column-count: 2 !important;
  }
}

@media screen and (max-width: 768px) {
  .card-fill {
    .el-descriptions {
      --el-descriptions-column-count: 1 !important;
      margin-bottom: 12px;

      .title {
        font-size: 14px;
        margin-bottom: 8px;
        padding: 4px 0;

        i {
          font-size: 15px;
        }
      }

      :deep(.el-descriptions__cell) {
        &.el-descriptions__label {
          width: 100px !important;
        }

        padding: 8px;
      }
    }

    .details-upload-img {
      :deep(.el-upload-list__item) {
        img {
          width: 100%;
          height: 160px;
        }
      }
    }

    .footer {
      margin-top: 16px;
      padding-top: 10px;
    }
  }
}
